Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODPart


Drop

The Drop method should move or copy the dragged data into this part.

ODDropResult Drop (in ODDragItemIterator dropInfo,
                   in ODFacet facet,
                   in ODPoint where);
dropInfo
A reference to a drag-item iterator that describes the content, as well as the types and values, of the dragged data.
facet
A reference to a facet where the drop has occurred.
where
The location of the drop point, expressed in frame coordinates.
return value
The result of the drop operation. The return value is one of the following: kODDropFail, kODDropCopy, kODDropMove, or kODDropUnfinished.
DISCUSSION
The return value kODDropFail indicates an unsuccessful synchronous drop. On platforms that support asynchronous drag-and-drop operations, the return value kODDropUnfinished indicates that an asynchronous drop is in progress. The return value kODDropCopy indicates a successful synchronous drop with copy semantics. The return value kODDropMove indicates a successful synchronous drop with move semantics. These copy and move semantics are determined by examining the drag attributes and determining whether to display the Paste As dialog box. If a link is created, then your part's Drop method should return kODDropCopy, regardless of the drag attributes.

OpenDoc calls this method when the mouse button is released while the drag point is within a facet that can accept a drop.

Your part's Drop method should examine the part kinds of the dragged data (using the drag-item iterator specified by the dropInfo parameter) and determine whether it can accept the dragged data. If your part can accept a drop, this method should incorporate or embed the dropped data and return an appropriate return value indicating the result of the drop operation. If your part cannot accept a drop, this method should return kODDropFail.

OVERRIDING
When you subclass ODPart, you can override this method. Your override method must not call its inherited method; that is, your override method must implement this method's functionality completely.

EXCEPTIONS
kODErrDoesNotDrop
This part does not support drag and drop.
SEE ALSO
The ODDropResult type (page 922).
The ODPoint type (page 885).
The ODDragAndDrop::GetDragAttributes method (page 191).
The ODDragAndDrop::ShowPasteAsDialog method (page 192).
The ODPart::DropCompleted method (page 508).
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"Paste As" on page 250 in OpenDoc Programmer's Guide.
"Dropping" on page 364 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help